<template>
    <div class="checkbox">
        <div>
            <el-form :inline="true" class="demo-form-inline">
                <el-form-item>
                    <el-select v-model="select" placeholder="请选择">
                        <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item>
                    <el-input
                            placeholder="请输入内容"
                            v-model="input"
                            clearable>
                    </el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>
                </el-form-item>
            </el-form>
        </div>

    </div>
</template>

<script>
    export default {
        name: 'checkbox',
        data() {
            return {
                input: '',
                select: '',
                options: [{
                    value: '职位',
                    label: '职位'
                }, {
                    value: '公司',
                    label: '公司'
                }
                ],
                value: '',
            }
        },
        methods: {
            search() {
                var params = new URLSearchParams();
                params.append('select', this.select)
                params.append('input',this.input)
                this.axios.post('http://localhost:8001/compjob/search',params).then((res)=>{
                    // console.log(res.data.msg);
                    this.$store.state.tableData1 = res.data
                    console.log( this.$store.state.tableData1)
                }).catch((err)=>{
                    console.log('error'+err);
                })
            }
        }
    }
</script>
<style scoped>
    .checkbox{
        display: flex;
        flex-direction: row;
        justify-content: center;
    }
</style>

